import java.io.File;
import java.util.Collection;

import org.apache.commons.io.FileUtils;
import org.junit.Test;

public class FileUtilTest {

	@Test
	public void testDeleteFile() {
		File f = new File("D:/百度云同步盘/Workspaces/Eclipse/mybatis-generator/src/main/java");
		Collection<File> files = FileUtils.listFiles(f, null, true);
		for (File file : files) {
			if (file.getName().replace(".java", "").endsWith("Mapper")) {
				file.delete();
			}
		}
	}
}
